package com.spring.service.impl;

import com.spring.dao.UserDao;
import com.spring.service.UserService;

/**
 * @Author 咕唧
 * @Date 2022/5/18 20:31
 * @Version 1.0
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao;

    public UserServiceImpl() {
        System.out.println("userDao执行了");
    }

    public void init(){
        System.out.println("UserService中的init方法执行了");
    }

    public void destroy(){
        System.out.println("UserService中的destroy方法执行了");
    }
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void addUser() {
        userDao.addUser();
        System.out.println("userservice方法执行了");
    }
}
